// 创建应用程序的路由器
import Vue from 'vue'
import VueRouter from 'vue-router'
// 此时就可以在Vue实例中配置路由器了
Vue.use(VueRouter)

// 引入组件
import Index from '../views/index'
import Login from '../views/login'

// 创建并暴露一个路由器
export default new VueRouter({
    routes:[
        {
            path: '/',
            component: Index,
            redirect: '/cpgl',
            children: [
                {
                    path: '/cpgl',
                    name: 'cpgl',
                    component: () => import(('@/components/cpgl'))
                },
                {
                    path: '/ddgl',
                    name: 'ddgl',
                    component: () => import(('@/components/ddgl'))
                }
            ]
        },
        {
            path: '/login',
            component: Login
        }
    ]
})
